package kr.pfg.applications.captureyourscreen.events
{
	import flash.display.BitmapData;
	import flash.events.Event;

	public class CaptureEvent extends Event
	{
		static public const CAPTURE_REGION: String = "captureRegion";
		static public const CAPTURE_FULL: String = "captureFull";
		static public const CAPTURE_SUCCESS:String = "captureSuccess";
		
		// protect original data.
		private var _captured:BitmapData;
		public function get captured(): BitmapData
		{
			return this._captured.clone();
		}
		
		public function CaptureEvent(type:String, bmd:BitmapData = null, bubbles:Boolean=false, cancelable:Boolean=false)
		{
			super(type, bubbles, cancelable);
			
			if( bmd )
				this._captured = bmd;
		}
		
		public override function clone():Event
		{
			return new CaptureEvent( type, captured, bubbles, cancelable );
		}
		
	}
}